/**
 * GameResultsController
 * 
 * @author Joshua Stein
 *
 */
package edu.bu.cs673.superkids123.children.controller.games;


import java.util.List;

import edu.bu.cs673.superkids123.AbstractController;
import edu.bu.cs673.superkids123.AbstractFrame;

import edu.bu.cs673.superkids123.children.view.ActivitiesMenuView;
import edu.bu.cs673.superkids123.children.view.games.GameResultsView;
import edu.bu.cs673.superkids123.common.model.Achievement;

public class GameResultsController extends AbstractController {
	
	/* Note: public attributes are not recommended */
	public int correct, wrong;
	public boolean inArithmaticGame, inMatchGame;
	public boolean inNumberMatchingGame, inSubtractionGame;
	public boolean inArcheryGame;
	private List<Achievement> earnedAchievements;

	public GameResultsController(AbstractFrame mainFrame) {
		super(mainFrame);
		reset();
		inArithmaticGame = false;
		inMatchGame = false;
		inNumberMatchingGame = false;
		inSubtractionGame = false;
		inArcheryGame = false;
	}

	public void returnToMenuButtonPressed() {
		getMainFrame().changeView(ActivitiesMenuView.class);
	}
	public void reset(){
		correct = 0; wrong = 0;
	}
	public void notifyResultsController(String gameName	){
		reset();
		inArithmaticGame = ( gameName == "Arithmatic Game");
		inMatchGame = ( gameName == "Match Game");
		inNumberMatchingGame = (gameName == "Number Matching Game");
		inSubtractionGame = (gameName == "Subtraction Game");
		inArcheryGame = (gameName == "Archery Game");
	}
	
	public void showResultsScreen(List<Achievement> earned) {
		this.earnedAchievements = earned;
		getMainFrame().changeView(GameResultsView.class);
	}

	public int getCorrect() {
		return correct;
	}

	public void setCorrect(int correct) {
		this.correct = correct;
	}

	public int getWrong() {
		return wrong;
	}

	public void setWrong(int wrong) {
		this.wrong = wrong;
	}

	public boolean isInArithmaticGame() {
		return inArithmaticGame;
	}

	public void setInArithmaticGame(boolean inArithmaticGame) {
		this.inArithmaticGame = inArithmaticGame;
	}

	public boolean isInMatchGame() {
		return inMatchGame;
	}

	public void setInMatchGame(boolean inMatchGame) {
		this.inMatchGame = inMatchGame;
	}

	public boolean isInNumberMatchingGame() {
		return inNumberMatchingGame;
	}

	public void setInNumberMatchingGame(boolean inNumberMatchingGame) {
		this.inNumberMatchingGame = inNumberMatchingGame;
	}

	public boolean isInSubtractionGame() {
		return inSubtractionGame;
	}

	public void setInSubtractionGame(boolean inSubtractionGame) {
		this.inSubtractionGame = inSubtractionGame;
	}
	
	public boolean isInArcheryGame() {
		return inArcheryGame;
	}

	public void setInArcheryGame(boolean inArcheryGame) {
		this.inArcheryGame = inArcheryGame;
	}

	public List<Achievement> getEarnedAchievements() {
		return earnedAchievements;
	}
}
